#include <iostream>
#include <unistd.h>

void *threadstart(void *args)
{
    while (true)
    {
        std::cout << "new thread running..." << ",pid:" << getpid() << std::endl;
        sleep(1);
    }
}
int main()
{
    pthread_t tid;
    pthread_create(&tid, nullptr, threadstart, (void *)"thread-new");
    // 主线程
    while (true)
    {
        sleep(1);
        std::cout << "main thread running..." << ",pid:" << getpid() << std::endl;
    }

    return 0;
}